package cn.csust.net2.manager.client.ux;

import cn.csust.net2.manager.shared.po.Authority;

import com.google.gwt.event.shared.GwtEvent;
/**
 * 当发生左侧模块树的点击事件时候，触发该事件，事件封装了所点击的组件包含的模块权限信息
 * @author 韩忠金
 *
 */
public class AuthorityEvent extends GwtEvent<AuthorityEventHandler> {
	//事件中封装的权限信息
	private Authority authority;
	public static final GwtEvent.Type<AuthorityEventHandler> TYPE =  new GwtEvent.Type<AuthorityEventHandler>();
	public AuthorityEvent(Authority authority){
		super();
		this.authority = authority;
	}
	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<AuthorityEventHandler> getAssociatedType() {
		
		return TYPE;
	}

	@Override
	protected void dispatch(AuthorityEventHandler handler) {
		
		handler.load(this);
		
	}

	public void setAuthority(Authority authority) {
		this.authority = authority;
	}

	public Authority getAuthority() {
		return authority;
	}
}
